import request from '@/utils/request'





export function login(data) {
  return request({
    url: '/fl-registerOrLogin/loginUser',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/fl-user/getUserByToken',
    method: 'get',
    headers: {'Authorization': token}
  })
}

export function logout(token) {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post',
    headers: {'X-Token': token}
  })
}

export function getAuthMenu(token) {
  return request({
    // url: '/fl-menu/getMenuList',   旧获取菜单接口
    url: '/fl-menu/getMenuList2',
    method: 'get',
    headers: {'Authorization': token}
  })
}



export function getDiffLevel() {
  return request({
    url: '/fl-admin/getDiffLevelUserCount',
    method: 'get',
   
  })
}

export function getshowAllBooks() {
  return request({
    url: '/fl-admin/showAllBooks',
    method: 'get',
   
  })
}

export function getshowAllUsers() {
  return request({
    url: '/fl-admin/showAllUsers',
    method: 'get',
   
  })
}

export function getAllOrderCountAndPrice() {
  return request({
    url: '/fl-admin/getAllOrderCountAndPrice',
    method: 'get',
   
  })
}

export function selectOrdersByTime(params) {   //时间段查询订单总数和订单总金额
  return request({
    url: '/fl-admin/selectOrdersByTime',
    method: 'get',
    params
  })
}

export function getgrowth(data) {     //获取本周/月订单总金额和总数（同比增长）
  return request({
    url: '/fl-admin/getWeekOrderCountAndPrice',
    method: 'post',
    data
  })
}

export function showAllBooks() {     //获取商品总览
  return request({
    url: '/fl-admin/showAllBooks',
    method: 'get',
   
  })
}

export function selectAllOrder(params) {     //获取订单总览
  return request({
    url: '/fl-admin/selectAllOrder',
    method: 'get',
    params
  })
}


